@@ -43,10 +43,11 @@ module Agents |
||
43 | 43 |
incoming_events.each do |event| |
44 | 44 |
tweet_text = Utils.value_at(event.payload, options['message_path']) |
45 | 45 |
begin |
46 |
- publish_tweet tweet_text |
|
46 |
+ tweet = publish_tweet tweet_text |
|
47 | 47 |
create_event :payload => { |
48 | 48 |
'success' => true, |
49 | 49 |
'published_tweet' => tweet_text, |
50 |
+ 'tweet_id' => tweet.id, |
|
50 | 51 |
'agent_id' => event.agent_id, |
51 | 52 |
'event_id' => event.id |
52 | 53 |
} |
@@ -22,7 +22,10 @@ describe Agents::TwitterPublishAgent do |
||
22 | 22 |
@event.save! |
23 | 23 |
|
24 | 24 |
@sent_messages = [] |
25 |
- stub.any_instance_of(Agents::TwitterPublishAgent).publish_tweet { |message| @sent_messages << message} |
|
25 |
+ stub.any_instance_of(Agents::TwitterPublishAgent).publish_tweet { |message| |
|
26 |
+ @sent_messages << message |
|
27 |
+ OpenStruct.new(:id => 454209588376502272) |
|
28 |
+ } |
|
26 | 29 |
end |
27 | 30 |
|
28 | 31 |
describe '#receive' do |
@@ -53,4 +56,4 @@ describe Agents::TwitterPublishAgent do |
||
53 | 56 |
@checker.reload.should_not be_working # More time has passed than the expected receive period without any new events |
54 | 57 |
end |
55 | 58 |
end |
56 |
-end |
|
59 |
+end |